package com.pan.domain;

import com.pan.domain.invariability.GlobalInformation;

public class Dot {
    int x;
    int y;

    public Dot(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Dot() {
    }
    public int getX() {
        return x;
    }

    public Dot setX(int x) {
        this.x = x;
        return this;
    }

    public int getY() {
        return y;
    }


    public Dot setY(int y) {
        this.y = y;
        return this;
    }

    public int getRelativeX(){
        return  GlobalInformation.getRelativeOriginX(x);
    }
    public int getRelativeY(){
        return  GlobalInformation.getRelativeOriginY(y);
    }

    public String toAbsoluteString(){
        return "Absolute: x,y = ["+x+", "+y+"]";
    }

    public String toRelativeString(){
        return "Relative: x,y = ["+ GlobalInformation.getRelativeOriginX(x)
                +", "+GlobalInformation.getRelativeOriginY(y)+"]";
    }

    @Override
    public String toString() {
        return toAbsoluteString() + "\n"
               + toRelativeString() + "\n"
                + GlobalInformation.getOriginXYString() +"\n";
    }
}
